<?php
/***************************************************************************
 * 
 * Copyright (c) 2010 , Inc. All Rights Reserved
 * $Id$:PHPProxy.php,2010/05/10 16:00:31 
 * 
 **************************************************************************/
 
 
 
/**
 * @file PHPProxy.php
 * @author huqingping
 * @date 2010/05/10 16:00:31
 * @version 1.0 
 * @brief 
 *  
 **/

class PHPProxy extends BaseProxy 
{
	private $srcCaller = null;

	function __construct($mod)
	{
		parent::__construct($mod);
	}

	function init($conf,$params)
	{
		$confroot = $conf['conf_path'];
		$approot = $conf['app_path'];
		$mod = $this->getMod();
		//支持多级的子模块
		$modseg = explode('/',$mod);
		//自动加载app mod conf
		Conf::load($confroot.$modseg[0].'.conf.php');
		$modseg =  array_map('ucfirst',$modseg);
		//类名以每一级单词大写开始
		$class = implode('', $modseg).'Export';
		$path = $approot.$mod.'/'.$modseg[count($modseg)-1].'Export.php';
		require_once $path;
		$this->srcCaller = new $class($params);
	}

	function call($name,$args)
	{
		$ret = call_user_func_array(array($this->srcCaller,$name),$args);
		return $ret;
	}
}



/* vim: set ts=4 sw=4 sts=4 tw=100 noet: */